<div id="map2" style="height: 100%;width:100%">

</div>

<script type="text/javascript">
    function initMap2(d){
        var myChart = echarts.init(document.getElementById('map2'), 'macarons');
        var planePath = 'path://M1705.06,1318.313v-89.254l-319.9-221.799l0.073-208.063c0.521-84.662-26.629-121.796-63.961-121.491c-37.332-0.305-64.482,36.829-63.961,121.491l0.073,208.063l-319.9,221.799v89.254l330.343-157.288l12.238,241.308l-134.449,92.931l0.531,42.034l175.125-42.917l175.125,42.917l0.531-42.034l-134.449-92.931l12.238-241.308L1705.06,1318.313z';
        var color = ['#a6c84c', '#ffa022', '#46bee9', '#D1E9B1', '#7DFF21'];
        var series = [];
        var legend = [];
        d.data.forEach(function (item, i) {
            series.push({
                    name: item.name,
                    type: 'lines',
                    zlevel: 1,
                    effect: {
                        show: true,
                        period: 6,
                        trailLength: 0.7,
                        color: '#fff',
                        symbolSize: 3
                    },
                    lineStyle: {
                        normal: {
                            color: color[i],
                            width: 0,
                            curveness: 0.2
                        }
                    },
                    data: item.res
                },
                {
                    name: item.name,
                    type: 'lines',
                    zlevel: 2,
                    symbol: ['none', 'arrow'],
                    symbolSize: 2,
                    effect: {
                        show: true,
                        period: 10,
                        trailLength: 0,
                        symbolSize: 1
                    },

                    lineStyle: {
                        normal: {
                            color: color[i],
                            width: 1,
                            opacity: 0.6,
                            curveness: 0.2
                        }
                    },
                    data: item.res
                });
        });


        option = {
            backgroundColor: '#ffffff',
            title: {
                text: '配送中心分配情况',
                left: 'center',
                textStyle: {
                    color: '#fff',
                    fontFamily: '微软雅黑1'
                }
                , show: false
            },
            toolbox: {
                left: 'left',
                feature: {
                    restore: {},
                    saveAsImage: {}
                }
            },
            tooltip: {
                trigger: 'item'
            },
            legend: {
                orient: 'vertical',
                top: 'bottom',
                left: 'right',
                data: legend,
                textStyle: {
                    color: '#fff'
                }
            },
            geo: {
                map: 'china',
                label: {
                    emphasis: {
                        show: false
                    }
                },
                roam: true,
                itemStyle: {
                    normal: {
                        areaColor: '#323c48',
                        borderColor: '#495161'
                    },
                    emphasis: {
                        areaColor: '#495161'
                    }
                }
            },
            series: series
        };
        myChart.setOption(option);
    }
</script>